#pragma once

#include "Stdafx.h"
#include "Vec2Mn.h"
#include "xForm.h"

using namespace System;
using namespace System::Runtime::InteropServices;

namespace OrionFlamesMn
{
	public ref class XFormMn
	{
	public:
		XFormMn(xForm* xform)
		{
			m_XForm = xform;
			m_X = gcnew Vec2Mn(&m_XForm->X());
			m_Y = gcnew Vec2Mn(&m_XForm->Y());
			m_O = gcnew Vec2Mn(&m_XForm->O());
			m_RotatedX = gcnew Vec2Mn(&m_XForm->RotatedX());
			m_RotatedY = gcnew Vec2Mn(&m_XForm->RotatedY());
			m_RotatedO = gcnew Vec2Mn(&m_XForm->RotatedO());
		}

		inline Variation* Var() { return m_XForm->Var(); }
		inline void Var(Variation* var) { m_XForm->Var(var); }
		inline System::String^ VariationName() { return gcnew System::String(m_XForm->VariationName().c_str()); }
		inline System::String^ Tag() { return gcnew System::String(m_XForm->Tag().c_str()); }

		property float Weight
		{
			float get() { return m_XForm->Weight(); }
			void set(float weight) { m_XForm->Weight(weight); }
		}

		property float NonlinearWeight
		{
			float get() { return m_XForm->NonlinearWeight(); }
			void set(float nonlinearWeight) { m_XForm->NonlinearWeight(nonlinearWeight); }
		}

		property Vec2Mn^ X
		{
			Vec2Mn^ get() { return m_X; }
		}

		property Vec2Mn^ Y
		{
			Vec2Mn^ get() { return m_Y; }
		}

		property Vec2Mn^ O
		{
			Vec2Mn^ get() { return m_O; }
		}

		property Vec2Mn^ RotatedX
		{
			Vec2Mn^ get() { return m_RotatedX; }
		}

		property Vec2Mn^ RotatedY
		{
			Vec2Mn^ get() { return m_RotatedY; }
		}

		property Vec2Mn^ RotatedO
		{
			Vec2Mn^ get() { return m_RotatedO; }
		}

	private:
		xForm* m_XForm;
		Vec2Mn^ m_X;
		Vec2Mn^ m_Y;
		Vec2Mn^ m_O;
		Vec2Mn^ m_RotatedX;
		Vec2Mn^ m_RotatedY;
		Vec2Mn^ m_RotatedO;
	};
}